home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / sound / players / eplay20.arc / eplay.doc < prev    next >
Text File  |  1990-07-22  |  8KB  |  179 lines

  1.  
  2.                      *********** Eplay ***********
  3.                           Version 2.0 07/22/90
  4.                              Public Domain
  5.  
  6.                       The STe audio sample player
  7.                       (via the STe DMA soundchip)
  8.  
  9.                              By: AAron nAAs
  10.                        AAron@sun.soe.clarkson.edu
  11.  
  12.                      *****************************
  13.  
  14.  
  15. To use Eplay effectively you should understand at least "a little"
  16. about how the STe DMA sound chip works.  The info given to it stays in
  17. it until it is intentionally changed.  Among the information the chip
  18. can be given, are the playback RATE (6.25/12.5/25/50 kHz.), Mono/Stereo
  19. MODE and the location of the SAMPLE.  And of course how to PLAY the
  20. sample, Once/Loop/Stop.  Master Volume, Left/Right Channel Volume,
  21. Treble, Bass and Mix are also settable.  So if you play a sample with
  22. certain parameters, then play another sample without specifying new
  23. parameters, the old settings will still be used ("remembered").
  24.  
  25. The sample memory is a collection of contiguous Words (two bytes) where
  26. each byte is a Signed number (from -128 to 127) which represents the
  27. speaker displacement, where 0 is "neutral."  If the chip is in stereo
  28. mode, the upper byte of each word is played through the left speaker,
  29. and the lower byte through the right speaker.  So, to play a sample only
  30. through one speaker, the sample must be loaded into every other byte.
  31.  
  32.                                **********
  33.  
  34. There are many ways a sample can be stored, one way (a very popular
  35. format for ST audio samples), is that each byte is an UNSIGNED number.
  36. Eplay can translate these bytes to Signed numbers while loading, so that
  37. they playback correctly.
  38.  
  39. Another problem arises when you try to play a sound that wasn't sampled
  40. in one of the four playback rates the chip supports.  There is more to
  41. the sample conversion than just skipping or stuffing bytes to adjust
  42. the playback rate (It wouldn't sound right).  I will be working on a
  43. progam that recalculates samples from one sample rate to another sample
  44. rate.  So, until then, if you want to play a sound that was sampled at
  45. the popular 10kHz or 15kHz rates, you have to live with chosing a
  46. sample playback rate that is "close" to the rate you want.
  47.  
  48.                                **********
  49.  
  50. ALSO remember that each time you run a program, it is most likely that
  51. all free memory is cleared.  So if you start a sample looping, it will
  52. continue playing correctly until you run another program (where the
  53. sample will be blanked, and it will end up playing whatever is put
  54. there), unless you protect the sample when you load it.  Of course if
  55. you protect a sample you loose some free memory (more precisely the
  56. amount just about equals the size of the sample plus the size of the
  57. player, even though its only the sample you wanted to protect).
  58.  
  59.                                **********
  60.  
  61.         Usage:
  62.  
  63.                                **********
  64.  
  65. (Rename eplay.tos to eplay.ttp if you want to pass parameters from the desktop)
  66.  
  67. Examples (all examples are to be considered independant of each other,
  68.           and note that the input is not case sensative, and the order
  69.           of the parameters does not matter):
  70.  
  71. 1)       eplay sample1.spl
  72.                              (will play sample1.spl at 12kHz, in mono
  73.                               mode, once, which are defaults)
  74.  
  75. 2)       eplay -lu sample1.spl -r0 -ms -pl
  76.                              (will play sample1.spl at 6.25kHz, in stereo
  77.                               mode, looping continuously.  It will continue
  78.                               playing the memory where the sample is/was,
  79.                               and if something happens to the memory where
  80.                               the sample is/was, it ends up playing whatever
  81.                               happens to end up in that location.  This won't
  82.                               hurt anything, it will just end up sounding
  83.                               really wierd.
  84.                               The 'u' after the "-l" causes the sample to be
  85.                               translating from Unsigned bytes.)
  86.          eplay -ps
  87.                              (Stops the sample playing)
  88.  
  89. 3)       eplay -lu sample1.spl -r3 -ms -pl -k
  90.                              (will do what the above did, but the "-k"
  91.                               informs the computer to "Keep" the memory
  92.                               so it is not corrupted in the future.
  93.                               Sample1.spl will continue to play again, and
  94.                               again, and again, ...)
  95.          eplay -ps
  96.                              (Stops the sample playing)
  97.          eplay -pl
  98.             or               (Starts it looping again)
  99.          eplay -po
  100.                              (Plays it one more time)
  101.  
  102. 4)       eplay -lu sample1.spl -r3 -mm -pl -k
  103.  
  104.          eplay -r2
  105.                              (slows loaded sample to 24.5 kHz)
  106.          eplay -ms
  107.                              (switches play Mode to Stereo, which since it
  108.                               is playing two bytes at a time, effectively
  109.                               doubles the playback rate)
  110.          eplay -po
  111.            or                (Lets the sample play to completion then stops)
  112.          eplay -ps
  113.                              (Stops the sample immediately)
  114.  
  115. 5)       eplay -lru sample1.spl -r0 -pl -k
  116.                              (Loads sample1.spl into only the Right speaker,
  117.                               translating Unsigned, and plays at 6.25 kHz.,
  118.                               and "Keeps" it's memory.  We note the locations
  119.                               that eplay loaded the sample into, and refer
  120.                               to them as 0xStart and 0xEnd in the next line.
  121.                               The program saw "-lr", and assumed stereo Mode)
  122.          eplay -llu sample2.spl -s 0xStart 0xEnd
  123.                              (Loads sample2.spl into only the Left speaker,
  124.                               translating Unsigned, and loads as much as it
  125.                               can into the memory protected by the above line.
  126.                               Note the memory has already been protected, so
  127.                               there is no need to protect it again.)
  128.  
  129.                              (Result: sample1.spl playing from right speaker,
  130.                               sample2.spl playing from left speaker, over,
  131.                               and over, and over ... at 6.25 kHz.)
  132.          eplay -ps
  133.                              (Stops the sample playing)
  134.  
  135. (Try something like this!!)
  136. 6)       eplay -lru sample1.spl -r1 -k -pl
  137.                              (Noting 0xStart and 0xEnd again, now add 0x1000
  138.                               to 0xStart and call it 0xStart2 and put our
  139.                               values into the next line.)
  140.          eplay -llu sample1.spl -s 0xStart2 0xEnd
  141.  
  142.                              (You should end up with the whole sample playing
  143.                               in the right ear, and in the left ear, the same
  144.                               sample lagging behind by 0x1000 bytes, and
  145.                               missing the last 0x1000 bytes, pretty weird
  146.                               sounding!)
  147.          eplay -ps
  148.                              (Stops the sample playing)
  149.  
  150.                                **********
  151.  
  152. Final words:
  153.  
  154. Have fun, and remember that if you use the "-k" option, you don't get your
  155. free memory back!!!
  156. And, you can play memory ANYWHERE in the computer with the "-s" option,
  157. but if you start loading samples into memory that you haven't protected,
  158. (Kept with "-k"), you could crash your computer or corrupt other programs!
  159. But hey, just turn the computer off, and start playing again!
  160.  
  161.                                **********
  162.  
  163. Possession stuff:
  164.  
  165. As stated previously, I am releasing this into the public domain, though I
  166. reserve all rights to the executable and the sourcecode.  Copying and
  167. distributing this package AS A WHOLE is not only permitted, but encouraged.
  168. If profit can be made using this package, or ANY part of it, an agreement
  169. must be made with me before any profit can be collected.  
  170.  
  171. Ad